package org.zwd.computePrice.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateUtils {
	public static String getToday(){
		Date date=new Date();
		DateFormat format=new SimpleDateFormat("yyyy-MM-dd");
		String time=format.format(date);
		return time;
	}
	
	public static String time2String(Date date){
		SimpleDateFormat format =  new SimpleDateFormat(" yyyy-MM-dd HH:mm:ss ");
		String dateString = format.format(date);
		return dateString;
	}
	
	public static String date2String(Date date){
		SimpleDateFormat format =  new SimpleDateFormat(" yyyy-MM-dd");
		String dateString = format.format(date);
		return dateString;
	}
	
	public static String getTomorrow(){
		Date date = new Date();
		Calendar calendar = new GregorianCalendar();
		calendar.setTime(date);
		calendar.add(Calendar.DATE, +1);
		DateFormat format=new SimpleDateFormat("yyyy-MM-dd");
		String time=format.format(calendar.getTime());
		return time;
	}
}
